package com.aspose.cells;

final class zvq {
   static void a(zif var0, com.aspose.cells.b.a.b.zp var1, boolean var2) {
      if (!b(var0) && !zbuk.a(var1)) {
         double var3 = (double)var0.m() / 100.0D;
         double var5 = (double)var0.n() / 100.0D;
         double var7 = (double)var0.o() / 100.0D;
         boolean var9 = false;
         int var10 = var0.z().h();
         int var11 = var0.z().getCount();
         boolean var12 = a(var0.M());
         if (var12) {
            var11 = 1;
         }

         int var31;
         if (var0.e().k() == 2) {
            if (b(var0.M())) {
               if (!var0.e().f() && !var0.u()) {
                  var31 = zbq.a(var0.e().j(), (int)var0.e().z(), (int)var0.e().D(), var0.S());
                  if (var31 == 0) {
                     var31 = 1;
                  }
               } else {
                  var31 = zbq.a(var0.e().j(), (int)var0.e().z(), (int)var0.e().D(), var0.S()) + 1;
               }
            } else {
               var31 = zbq.a(var0.e().j(), (int)var0.e().z(), (int)var0.e().D(), var0.S()) + 1;
            }
         } else if (b(var0.M())) {
            if (!var0.e().f() && !var0.u()) {
               var31 = var10 - 1;
               if (var31 == 0) {
                  var31 = 1;
               }
            } else {
               var31 = var10;
            }
         } else {
            var31 = var10;
         }

         double var13 = 0.0D;
         if (var12) {
            var13 = (double)var31 / var3;
         } else if (!a(var0)) {
            var13 = (double)var31 * ((double)var11 + var7) / (var3 + var5 * var3);
         } else {
            var13 = (double)var31 / ((double)var11 * var3);
         }

         double var15 = Math.abs(Math.sin((double)var0.p() * 3.141592653589793D / 180.0D));
         int var17 = var0.D() % 90;
         if (var17 >= 45) {
            var17 = 90 - var17;
         }

         double var18 = Math.sin((double)var17 * 3.141592653589793D / 180.0D);
         int var20 = var0.D() / 45;
         if (var0.r()) {
            float var21 = 1.0F;
            if (var0.z().getCount() == 1 && (var0.M() == 17 || var0.M() == 27 || var0.M() == 34 || var0.M() == 56)) {
               var21 = 0.67F;
            }

            double var22 = 0.0D;
            double var24 = 0.0D;
            double var26 = 0.0D;
            double var28 = 0.0D;
            switch(var20) {
            case 0:
            case 3:
            case 4:
            case 7:
            case 8:
               if (!var2) {
                  var22 = (double)var1.e() / (1.0D + var18 / var13);
                  var26 = (double)(var1.f() * var1.e()) / ((double)var1.e() * var15 / var13 + (double)var1.f());
               } else {
                  var22 = (double)(var1.e() * var1.e()) / ((double)var1.f() * var18 / var13 + (double)var1.e());
                  var26 = (double)var1.e() / (1.0D + var15 / var13);
               }
               break;
            case 1:
            case 2:
            case 5:
            case 6:
               var22 = (double)var1.e() / (1.0D / var13 + var18);
               var26 = (double)(var1.f() * var1.e()) / ((double)var1.e() * var15 + (double)var1.f());
            }

            var24 = var22 * (double)var1.f() / (double)var1.e();
            var28 = var26 * (double)var1.f() / (double)var1.e();
            if (var24 < var28) {
               var0.N().c((float)var22);
               var0.N().e((float)var24);
            } else {
               var0.N().c((float)var26);
               var0.N().e((float)var28);
            }

            var0.N().e(var0.N().i() * var21);
            var0.N().d(!var2 ? (float)((double)var0.N().g() / var13) : (float)((double)var0.N().i() / var13));
            var0.N().a((float)var1.c() + ((float)var1.e() - var0.N().g()) / 2.0F);
            var0.N().b((float)(var1.d() + var1.f()) - ((float)var1.f() - var0.N().i()) / 2.0F);
         } else {
            double var32 = (double)var0.q() / 100.0D;
            if (var0.z().getCount() == 1 && (var0.M() == 17 || var0.M() == 27 || var0.M() == 34 || var0.M() == 56)) {
               float var23 = 0.67F;
               var32 *= (double)var23;
            }

            double var33 = 0.0D;
            double var25 = 0.0D;
            double var27 = 0.0D;
            double var29 = 0.0D;
            switch(var20) {
            case 0:
            case 3:
            case 4:
            case 7:
            case 8:
               if (!var2) {
                  var33 = (double)var1.e() / (1.0D + var18 / var13);
                  var27 = (double)var1.f() / (var32 + var15 / var13);
               } else {
                  var33 = (double)var1.e() / (1.0D + var18 / var13 / var32);
                  var27 = (double)var1.f() * var32 / (1.0D + var15 / var13);
               }
               break;
            case 1:
            case 2:
            case 5:
            case 6:
               var33 = (double)var1.e() / (1.0D / var13 + var18);
               var27 = (double)var1.f() / (var15 + var32);
            }

            if (!var2) {
               var25 = var33 * var32;
               var29 = var27 * var32;
            } else {
               var25 = var33 / var32;
               var29 = var27 / var32;
            }

            if (var25 < var29) {
               var0.N().c((float)var33);
               var0.N().e((float)var25);
            } else {
               var0.N().c((float)var27);
               var0.N().e((float)var29);
            }

            var0.N().d(!var2 ? (float)((double)var0.N().g() / var13) : (float)((double)var0.N().i() / var13));
            var0.N().a((float)var1.c() + ((float)var1.e() - var0.N().g()) / 2.0F);
            var0.N().b((float)(var1.d() + var1.f()) - ((float)var1.f() - var0.N().i()) / 2.0F);
         }

      }
   }

   private static boolean a(int var0) {
      switch(var0) {
      case 10:
      case 11:
      case 19:
      case 20:
      case 22:
      case 23:
      case 25:
      case 26:
      case 29:
      case 30:
      case 32:
      case 33:
      case 51:
      case 52:
      case 54:
      case 55:
         return true;
      case 12:
      case 13:
      case 14:
      case 15:
      case 16:
      case 17:
      case 18:
      case 21:
      case 24:
      case 27:
      case 28:
      case 31:
      case 34:
      case 35:
      case 36:
      case 37:
      case 38:
      case 39:
      case 40:
      case 41:
      case 42:
      case 43:
      case 44:
      case 45:
      case 46:
      case 47:
      case 48:
      case 49:
      case 50:
      case 53:
      default:
         return false;
      }
   }

   private static boolean b(int var0) {
      switch(var0) {
      case 3:
      case 4:
      case 5:
      case 43:
         return true;
      default:
         return false;
      }
   }

   static void a(zn var0, zif var1, boolean var2) throws Exception {
      if (!b(var1) && !var1.B().D()) {
         float var3 = var1.N().j();
         float var4 = var1.N().f();
         com.aspose.cells.b.a.b.zo var5 = new com.aspose.cells.b.a.b.zo(var3, var4);
         int var6 = var1.D() % 90;
         if (var6 >= 45) {
            var6 = 90 - var6;
         }

         int var9 = var1.D() / 45;
         float var7;
         float var8;
         switch(var9) {
         case 0:
         case 3:
         case 4:
         case 7:
         case 8:
            var7 = var1.N().g();
            var8 = var1.N().h();
            break;
         case 1:
         case 2:
         case 5:
         case 6:
         default:
            var7 = var1.N().h();
            var8 = var1.N().g();
         }

         float var10 = var8 * (float)Math.sin((double)var6 * 3.141592653589793D / 180.0D);
         float var11 = var8 * (float)Math.sin((double)var1.p() * 3.141592653589793D / 180.0D);
         com.aspose.cells.b.a.b.zo[] var12 = new com.aspose.cells.b.a.b.zo[8];
         zbuk.a(var12);
         switch(var9) {
         case 0:
         case 8:
            var12[0].a(var5.d() - (var7 + var10) / 2.0F);
            var12[1].a(var12[0].d() + var7);
            var12[2].a(var12[1].d() + var10);
            var12[3].a(var12[0].d() + var10);
            var12[0].b(var5.e() + var11 / 2.0F);
            var12[1].b(var12[0].e());
            var12[2].b(var12[1].e() - var11);
            var12[3].b(var12[2].e());
            break;
         case 1:
            var12[0].a(var5.d() - (var7 + var10) / 2.0F);
            var12[1].a(var12[0].d() + var10);
            var12[2].a(var12[1].d() + var7);
            var12[3].a(var12[0].d() + var7);
            var12[0].b(var5.e() - var11 / 2.0F);
            var12[1].b(var12[0].e() + var11);
            var12[2].b(var12[1].e());
            var12[3].b(var12[0].e());
            break;
         case 2:
            var12[1].a(var5.d() - (var7 + var10) / 2.0F);
            var12[0].a(var12[1].d() + var10);
            var12[2].a(var12[1].d() + var7);
            var12[3].a(var12[0].d() + var7);
            var12[0].b(var5.e() - var11 / 2.0F);
            var12[1].b(var12[0].e() + var11);
            var12[2].b(var12[1].e());
            var12[3].b(var12[0].e());
            break;
         case 3:
            var12[1].a(var5.d() - (var7 + var10) / 2.0F);
            var12[0].a(var12[1].d() + var7);
            var12[2].a(var12[1].d() + var10);
            var12[3].a(var12[2].d() + var7);
            var12[0].b(var5.e() - var11 / 2.0F);
            var12[1].b(var12[0].e());
            var12[2].b(var12[1].e() + var11);
            var12[3].b(var12[2].e());
            break;
         case 4:
            var12[0].a(var5.d() + (var7 + var10) / 2.0F);
            var12[1].a(var12[0].d() - var7);
            var12[2].a(var12[1].d() - var10);
            var12[3].a(var12[2].d() + var7);
            var12[0].b(var5.e() - var11 / 2.0F);
            var12[1].b(var12[0].e());
            var12[2].b(var12[1].e() + var11);
            var12[3].b(var12[2].e());
            break;
         case 5:
            var12[0].a(var5.d() + (var7 + var10) / 2.0F);
            var12[1].a(var12[0].d() - var10);
            var12[2].a(var12[1].d() - var7);
            var12[3].a(var12[0].d() - var7);
            var12[0].b(var5.e() + var11 / 2.0F);
            var12[1].b(var12[0].e() - var11);
            var12[2].b(var12[1].e());
            var12[3].b(var12[0].e());
            break;
         case 6:
            var12[1].a(var5.d() + (var7 + var10) / 2.0F);
            var12[0].a(var12[1].d() - var10);
            var12[2].a(var12[1].d() - var7);
            var12[3].a(var12[0].d() - var7);
            var12[0].b(var5.e() + var11 / 2.0F);
            var12[1].b(var12[0].e() - var11);
            var12[2].b(var12[1].e());
            var12[3].b(var12[0].e());
            break;
         case 7:
            var12[1].a(var5.d() + (var7 + var10) / 2.0F);
            var12[0].a(var12[1].d() - var7);
            var12[2].a(var12[1].d() - var10);
            var12[3].a(var12[2].d() - var7);
            var12[0].b(var5.e() + var11 / 2.0F);
            var12[1].b(var12[0].e());
            var12[2].b(var12[1].e() - var11);
            var12[3].b(var12[2].e());
         }

         var12[4].a(var12[0].d());
         var12[5].a(var12[1].d());
         var12[6].a(var12[2].d());
         var12[7].a(var12[3].d());
         var12[4].b(var12[0].e() - var1.N().i());
         var12[5].b(var12[1].e() - var1.N().i());
         var12[6].b(var12[2].e() - var1.N().i());
         var12[7].b(var12[3].e() - var1.N().i());
         com.aspose.cells.b.a.a.ze.a(var1.N().a, (Object)(new com.aspose.cells.b.a.b.zo(var12[0].d(), var12[0].e())));
         com.aspose.cells.b.a.a.ze.a(var1.N().a, (Object)(new com.aspose.cells.b.a.b.zo(var12[1].d(), var12[1].e())));
         com.aspose.cells.b.a.a.ze.a(var1.N().a, (Object)(new com.aspose.cells.b.a.b.zo(var12[2].d(), var12[2].e())));
         com.aspose.cells.b.a.a.ze.a(var1.N().a, (Object)(new com.aspose.cells.b.a.b.zo(var12[3].d(), var12[3].e())));
         com.aspose.cells.b.a.a.ze.a(var1.N().a, (Object)(new com.aspose.cells.b.a.b.zo(var12[4].d(), var12[4].e())));
         com.aspose.cells.b.a.a.ze.a(var1.N().a, (Object)(new com.aspose.cells.b.a.b.zo(var12[5].d(), var12[5].e())));
         com.aspose.cells.b.a.a.ze.a(var1.N().a, (Object)(new com.aspose.cells.b.a.b.zo(var12[6].d(), var12[6].e())));
         com.aspose.cells.b.a.a.ze.a(var1.N().a, (Object)(new com.aspose.cells.b.a.b.zo(var12[7].d(), var12[7].e())));
         com.aspose.cells.b.a.b.zo[] var13 = new com.aspose.cells.b.a.b.zo[6];
         zbuk.a(var13);
         com.aspose.cells.b.a.b.zc var14;
         if (var2) {
            if (var1.p() >= 0) {
               var14 = zax.a(var1.s().c(), a(new com.aspose.cells.b.a.b.zo[]{var12[0], var12[3], var12[7], var12[4]}));

               try {
                  var0.a(var14, new com.aspose.cells.b.a.b.zo[]{var12[0], var12[3], var12[7], var12[4]});
               } finally {
                  if (var14 != null) {
                     var14.f();
                  }

               }
            }

            var14 = zax.a(var1.N().d(), a(new com.aspose.cells.b.a.b.zo[]{var12[0], var12[1], var12[2], var12[3]}));

            try {
               var0.a(var14, new com.aspose.cells.b.a.b.zo[]{var12[0], var12[1], var12[2], var12[3]});
            } finally {
               if (var14 != null) {
                  var14.f();
               }

            }

            com.aspose.cells.b.a.b.zc var15 = zax.a(var1.N().d(), a(new com.aspose.cells.b.a.b.zo[]{var12[2], var12[3], var12[7], var12[6]}));

            try {
               var0.a(var15, new com.aspose.cells.b.a.b.zo[]{var12[2], var12[3], var12[7], var12[6]});
            } finally {
               if (var15 != null) {
                  var15.f();
               }

            }

            if (!var1.E().p()) {
               var13[0] = var12[0];
               var13[1] = var12[1];
               var13[2] = var12[3];
               var13[3] = var12[2];
               var13[4] = var12[7];
               var13[5] = var12[6];
            } else {
               var13[0] = var12[1];
               var13[1] = var12[0];
               var13[2] = var12[2];
               var13[3] = var12[3];
               var13[4] = var12[6];
               var13[5] = var12[7];
            }

            a(var0, var1.E(), var13);
            if (!var1.e().p()) {
               var13[0] = var12[0];
               var13[1] = var12[4];
               var13[2] = var12[3];
               var13[3] = var12[7];
               var13[4] = var12[2];
               var13[5] = var12[6];
            } else {
               var13[0] = var12[4];
               var13[1] = var12[0];
               var13[2] = var12[7];
               var13[3] = var12[3];
               var13[4] = var12[6];
               var13[5] = var12[2];
            }

            a(var0, var1.e(), var13);
            a(var0, var1, var12, var2);
            com.aspose.cells.b.a.b.zm var16 = zama.a(var1.N().c());

            try {
               var0.a(var16, var12[0], var12[1]);
               var0.a(var16, var12[1], var12[2]);
               var0.a(var16, var12[2], var12[3]);
               var0.a(var16, var12[0], var12[3]);
               var0.a(var16, var12[2], var12[6]);
               var0.a(var16, var12[6], var12[7]);
               var0.a(var16, var12[7], var12[3]);
            } finally {
               if (var16 != null) {
                  var16.r();
               }

            }
         } else {
            if (var1.p() > 0) {
               var14 = zax.a(var1.s().c(), a(new com.aspose.cells.b.a.b.zo[]{var12[0], var12[1], var12[2], var12[3]}));

               try {
                  var0.a(var14, new com.aspose.cells.b.a.b.zo[]{var12[0], var12[1], var12[2], var12[3]});
               } finally {
                  if (var14 != null) {
                     var14.f();
                  }

               }
            }

            com.aspose.cells.b.a.b.zm var239 = zama.a(var1.N().c());

            try {
               switch(var9) {
               case 0:
               case 1:
               case 8:
                  com.aspose.cells.b.a.b.a.ze var240 = new com.aspose.cells.b.a.b.a.ze();
                  var240.b(new com.aspose.cells.b.a.b.zo[]{var12[0], var12[3], var12[7], var12[4]});
                  com.aspose.cells.b.a.b.zc var243 = zax.a(var1.N().d(), com.aspose.cells.a.c.zn.a(var240));

                  try {
                     var0.a(var243, new com.aspose.cells.b.a.b.zo[]{var12[0], var12[3], var12[7], var12[4]});
                  } finally {
                     if (var243 != null) {
                        var243.f();
                     }

                  }

                  com.aspose.cells.b.a.b.a.ze var17 = new com.aspose.cells.b.a.b.a.ze();
                  var17.b(new com.aspose.cells.b.a.b.zo[]{var12[2], var12[3], var12[7], var12[6]});
                  com.aspose.cells.b.a.b.zc var18 = zax.a(var1.N().d(), com.aspose.cells.a.c.zn.a(var17));

                  try {
                     var0.a(var18, new com.aspose.cells.b.a.b.zo[]{var12[2], var12[3], var12[7], var12[6]});
                  } finally {
                     if (var18 != null) {
                        var18.f();
                     }

                  }

                  if (!var1.E().p()) {
                     var13[0] = var12[0];
                     var13[1] = var12[4];
                     var13[2] = var12[3];
                     var13[3] = var12[7];
                     var13[4] = var12[2];
                     var13[5] = var12[6];
                  } else {
                     var13[0] = var12[4];
                     var13[1] = var12[0];
                     var13[2] = var12[7];
                     var13[3] = var12[3];
                     var13[4] = var12[6];
                     var13[5] = var12[2];
                  }

                  a(var0, var1.E(), var13);
                  if (!var1.e().p()) {
                     var13[0] = var12[0];
                     var13[1] = var12[1];
                     var13[2] = var12[3];
                     var13[3] = var12[2];
                     var13[4] = var12[7];
                     var13[5] = var12[6];
                  } else {
                     var13[0] = var12[1];
                     var13[1] = var12[0];
                     var13[2] = var12[2];
                     var13[3] = var12[3];
                     var13[4] = var12[6];
                     var13[5] = var12[7];
                  }

                  a(var0, var1.e(), var13);
                  if (!var1.I().p()) {
                     var13[0] = var12[1];
                     var13[1] = var12[2];
                     var13[2] = var12[0];
                     var13[3] = var12[3];
                     var13[4] = var12[4];
                     var13[5] = var12[7];
                  } else {
                     var13[0] = var12[2];
                     var13[1] = var12[1];
                     var13[2] = var12[3];
                     var13[3] = var12[0];
                     var13[4] = var12[7];
                     var13[5] = var12[4];
                  }

                  a(var0, var1.I(), var13);
                  a(var0, var1, var12, var2);
                  var0.a(var239, var12[0], var12[4]);
                  var0.a(var239, var12[3], var12[7]);
                  var0.a(var239, var12[2], var12[6]);
                  var0.a(var239, var12[0], var12[3]);
                  var0.a(var239, var12[3], var12[2]);
                  var0.a(var239, var12[7], var12[4]);
                  var0.a(var239, var12[7], var12[6]);
                  break;
               case 2:
               case 3:
                  com.aspose.cells.b.a.b.zc var19 = zax.a(var1.N().d(), a(new com.aspose.cells.b.a.b.zo[]{var12[0], var12[3], var12[7], var12[4]}));

                  try {
                     var0.a(var19, new com.aspose.cells.b.a.b.zo[]{var12[0], var12[3], var12[7], var12[4]});
                  } finally {
                     if (var19 != null) {
                        var19.f();
                     }

                  }

                  com.aspose.cells.b.a.b.zc var20 = zax.a(var1.N().d(), a(new com.aspose.cells.b.a.b.zo[]{var12[0], var12[1], var12[5], var12[4]}));

                  try {
                     var0.a(var20, new com.aspose.cells.b.a.b.zo[]{var12[0], var12[1], var12[5], var12[4]});
                  } finally {
                     if (var20 != null) {
                        var20.f();
                     }

                  }

                  if (!var1.E().p()) {
                     var13[0] = var12[1];
                     var13[1] = var12[5];
                     var13[2] = var12[0];
                     var13[3] = var12[4];
                     var13[4] = var12[3];
                     var13[5] = var12[7];
                  } else {
                     var13[0] = var12[5];
                     var13[1] = var12[1];
                     var13[2] = var12[4];
                     var13[3] = var12[0];
                     var13[4] = var12[7];
                     var13[5] = var12[3];
                  }

                  a(var0, var1.E(), var13);
                  if (!var1.e().p()) {
                     var13[0] = var12[3];
                     var13[1] = var12[2];
                     var13[2] = var12[0];
                     var13[3] = var12[1];
                     var13[4] = var12[4];
                     var13[5] = var12[5];
                  } else {
                     var13[0] = var12[2];
                     var13[1] = var12[3];
                     var13[2] = var12[1];
                     var13[3] = var12[0];
                     var13[4] = var12[5];
                     var13[5] = var12[4];
                  }

                  a(var0, var1.e(), var13);
                  if (!var1.I().p()) {
                     var13[0] = var12[1];
                     var13[1] = var12[2];
                     var13[2] = var12[0];
                     var13[3] = var12[3];
                     var13[4] = var12[4];
                     var13[5] = var12[7];
                  } else {
                     var13[0] = var12[2];
                     var13[1] = var12[1];
                     var13[2] = var12[3];
                     var13[3] = var12[0];
                     var13[4] = var12[7];
                     var13[5] = var12[4];
                  }

                  a(var0, var1.I(), var13);
                  a(var0, var1, var12, var2);
                  var0.a(var239, var12[0], var12[4]);
                  var0.a(var239, var12[3], var12[7]);
                  var0.a(var239, var12[1], var12[5]);
                  var0.a(var239, var12[0], var12[3]);
                  var0.a(var239, var12[0], var12[1]);
                  var0.a(var239, var12[7], var12[4]);
                  var0.a(var239, var12[4], var12[5]);
                  break;
               case 4:
               case 5:
                  com.aspose.cells.b.a.b.zc var21 = zax.a(var1.N().d(), a(new com.aspose.cells.b.a.b.zo[]{var12[0], var12[1], var12[5], var12[4]}));

                  try {
                     var0.a(var21, new com.aspose.cells.b.a.b.zo[]{var12[0], var12[1], var12[5], var12[4]});
                  } finally {
                     if (var21 != null) {
                        var21.f();
                     }

                  }

                  com.aspose.cells.b.a.b.zc var22 = zax.a(var1.N().d(), a(new com.aspose.cells.b.a.b.zo[]{var12[1], var12[2], var12[6], var12[5]}));

                  try {
                     var0.a(var22, new com.aspose.cells.b.a.b.zo[]{var12[1], var12[2], var12[6], var12[5]});
                  } finally {
                     if (var22 != null) {
                        var22.f();
                     }

                  }

                  if (!var1.E().p()) {
                     var13[0] = var12[0];
                     var13[1] = var12[4];
                     var13[2] = var12[1];
                     var13[3] = var12[5];
                     var13[4] = var12[2];
                     var13[5] = var12[6];
                  } else {
                     var13[0] = var12[4];
                     var13[1] = var12[0];
                     var13[2] = var12[5];
                     var13[3] = var12[1];
                     var13[4] = var12[6];
                     var13[5] = var12[2];
                  }

                  a(var0, var1.E(), var13);
                  if (!var1.e().p()) {
                     var13[0] = var12[3];
                     var13[1] = var12[2];
                     var13[2] = var12[0];
                     var13[3] = var12[1];
                     var13[4] = var12[4];
                     var13[5] = var12[5];
                  } else {
                     var13[0] = var12[2];
                     var13[1] = var12[3];
                     var13[2] = var12[1];
                     var13[3] = var12[0];
                     var13[4] = var12[5];
                     var13[5] = var12[4];
                  }

                  a(var0, var1.e(), var13);
                  if (!var1.I().p()) {
                     var13[0] = var12[3];
                     var13[1] = var12[0];
                     var13[2] = var12[2];
                     var13[3] = var12[1];
                     var13[4] = var12[6];
                     var13[5] = var12[5];
                  } else {
                     var13[0] = var12[0];
                     var13[1] = var12[3];
                     var13[2] = var12[1];
                     var13[3] = var12[2];
                     var13[4] = var12[5];
                     var13[5] = var12[6];
                  }

                  a(var0, var1.I(), var13);
                  a(var0, var1, var12, var2);
                  var0.a(var239, var12[0], var12[4]);
                  var0.a(var239, var12[1], var12[5]);
                  var0.a(var239, var12[2], var12[6]);
                  var0.a(var239, var12[0], var12[1]);
                  var0.a(var239, var12[1], var12[2]);
                  var0.a(var239, var12[4], var12[5]);
                  var0.a(var239, var12[5], var12[6]);
                  break;
               case 6:
               case 7:
                  com.aspose.cells.b.a.b.zc var23 = zax.a(var1.N().d(), a(new com.aspose.cells.b.a.b.zo[]{var12[1], var12[2], var12[6], var12[5]}));

                  try {
                     var0.a(var23, new com.aspose.cells.b.a.b.zo[]{var12[1], var12[2], var12[6], var12[5]});
                  } finally {
                     if (var23 != null) {
                        var23.f();
                     }

                  }

                  com.aspose.cells.b.a.b.zc var24 = zax.a(var1.N().d(), a(new com.aspose.cells.b.a.b.zo[]{var12[2], var12[3], var12[7], var12[6]}));

                  try {
                     var0.a(var24, new com.aspose.cells.b.a.b.zo[]{var12[2], var12[3], var12[7], var12[6]});
                  } finally {
                     if (var24 != null) {
                        var24.f();
                     }

                  }

                  if (!var1.E().p()) {
                     var13[0] = var12[3];
                     var13[1] = var12[7];
                     var13[2] = var12[2];
                     var13[3] = var12[6];
                     var13[4] = var12[1];
                     var13[5] = var12[5];
                  } else {
                     var13[0] = var12[7];
                     var13[1] = var12[3];
                     var13[2] = var12[6];
                     var13[3] = var12[2];
                     var13[4] = var12[5];
                     var13[5] = var12[1];
                  }

                  a(var0, var1.E(), var13);
                  if (!var1.e().p()) {
                     var13[0] = var12[0];
                     var13[1] = var12[1];
                     var13[2] = var12[3];
                     var13[3] = var12[2];
                     var13[4] = var12[7];
                     var13[5] = var12[6];
                  } else {
                     var13[0] = var12[1];
                     var13[1] = var12[0];
                     var13[2] = var12[2];
                     var13[3] = var12[3];
                     var13[4] = var12[6];
                     var13[5] = var12[7];
                  }

                  a(var0, var1.e(), var13);
                  if (!var1.I().p()) {
                     var13[0] = var12[3];
                     var13[1] = var12[0];
                     var13[2] = var12[2];
                     var13[3] = var12[1];
                     var13[4] = var12[6];
                     var13[5] = var12[5];
                  } else {
                     var13[0] = var12[0];
                     var13[1] = var12[3];
                     var13[2] = var12[1];
                     var13[3] = var12[2];
                     var13[4] = var12[5];
                     var13[5] = var12[6];
                  }

                  a(var0, var1.I(), var13);
                  a(var0, var1, var12, var2);
                  var0.a(var239, var12[3], var12[7]);
                  var0.a(var239, var12[1], var12[5]);
                  var0.a(var239, var12[2], var12[6]);
                  var0.a(var239, var12[2], var12[3]);
                  var0.a(var239, var12[1], var12[2]);
                  var0.a(var239, var12[6], var12[7]);
                  var0.a(var239, var12[5], var12[6]);
               }
            } finally {
               if (var239 != null) {
                  var239.r();
               }

            }
         }

         int var241 = a(var1.E(), var2);
         if (var241 != 0) {
            com.aspose.cells.b.a.b.zo[] var242 = zib.c(var1);
            if (var2) {
               zama.a(var0, var242[2].d() + (float)var241, var242[2].e(), var242[2].d() + (float)var241, var242[2].e() - var1.N().i(), var1.e().g());
            } else {
               zama.a(var0, var242[2].d(), var242[2].e() - (float)var241, var242[3].d(), var242[3].e() - (float)var241, var1.e().g());
            }
         }

      }
   }

   private static void a(zn var0, zif var1, com.aspose.cells.b.a.b.zo[] var2, boolean var3) {
      com.aspose.cells.b.a.b.zm var4 = zama.a(var1.s().a());

      try {
         if (var1.p() > 0) {
            if (var3) {
               var0.a(var4, var2[0], var2[3]);
               var0.a(var4, var2[3], var2[7]);
               var0.a(var4, var2[7], var2[4]);
               var0.a(var4, var2[4], var2[0]);
            } else {
               var0.a(var4, var2[0], var2[1]);
               var0.a(var4, var2[1], var2[2]);
               var0.a(var4, var2[2], var2[3]);
               var0.a(var4, var2[3], var2[0]);
            }
         }
      } finally {
         if (var4 != null) {
            var4.r();
         }

      }

   }

   private static void a(zn var0, zbo var1, com.aspose.cells.b.a.b.zo[] var2) {
      zif var3 = var1.c();
      int var6 = var1.j();
      double var7 = var1.n() ? zbuk.e(var1.z()) : var1.z();
      double var9 = var1.n() ? zbuk.e(var1.D()) : var1.D();
      double var11 = var1.n() ? zbuk.e(var1.x()) : var1.x();
      double var13 = var1.n() ? zbuk.e(var1.B()) : var1.B();
      double var4;
      if (var1.d() == 0 && var1.k() == 2) {
         var4 = (double)(zbq.a(var6, (int)var7, (int)var9, var3.S()) + 1);
      } else {
         var4 = var7 - var9;
      }

      double var15 = (double)(var2[1].d() - var2[0].d()) / var4;
      double var17 = (double)(var2[1].e() - var2[0].e()) / var4;
      double var19;
      com.aspose.cells.b.a.b.zo var21;
      com.aspose.cells.b.a.b.zo var22;
      com.aspose.cells.b.a.b.zo var23;
      double var24;
      if (var1.s().e() && var11 > 0.0D) {
         if (var1.d() == 0 && var1.k() == 2) {
            var19 = (double)zbq.a(var1.j(), var1.y(), (int)var11, (int)var9, var3.S());
         } else {
            var19 = var9 + var11;
         }

         var21 = zbuk.a(var2[0]);
         var22 = zbuk.a(var2[2]);
         var23 = zbuk.a(var2[4]);

         label116:
         while(true) {
            while(true) {
               if (var19 > var7 && (var1.d() != 0 || var1.k() != 2 || var19 > var7)) {
                  break label116;
               }

               if (var1.d() == 0 && var1.k() == 2) {
                  var24 = (double)zbq.a(var6, (int)var19, (int)var9, var3.S());
               } else {
                  var24 = var19 - var9;
               }

               var21.a(var2[0].d() + (float)(var15 * var24));
               var21.b(var2[0].e() + (float)(var17 * var24));
               var22.a(var2[2].d() + (float)(var15 * var24));
               var22.b(var2[2].e() + (float)(var17 * var24));
               var23.a(var2[4].d() + (float)(var15 * var24));
               var23.b(var2[4].e() + (float)(var17 * var24));
               zama.a(var0, var21, var22, var1.s());
               zama.a(var0, var22, var23, var1.s());
               if (var1.d() == 0 && var1.k() == 2) {
                  var19 = (double)zbq.a(var1.j(), var1.y(), (int)var11, (int)var19, var3.S());
               } else {
                  var19 += var11;
               }
            }
         }
      }

      if (var1.u().e() && var13 > 0.0D) {
         if (var1.d() == 0 && var1.k() == 2) {
            var19 = (double)zbq.a(var1.j(), var1.C(), (int)var1.B(), (int)var9, var3.S());
         } else {
            var19 = var9 + var13;
         }

         var21 = zbuk.a(var2[0]);
         var22 = zbuk.a(var2[2]);
         var23 = zbuk.a(var2[4]);

         while(true) {
            while(var19 <= var7 || var1.d() == 0 && var1.k() == 2 && var19 <= var7) {
               if (var1.d() == 0 && var1.k() == 2) {
                  var24 = (double)zbq.a(var6, (int)var19, (int)var9, var3.S());
               } else {
                  var24 = var19 - var9;
               }

               var21.a(var2[0].d() + (float)(var15 * var24));
               var21.b(var2[0].e() + (float)(var17 * var24));
               var22.a(var2[2].d() + (float)(var15 * var24));
               var22.b(var2[2].e() + (float)(var17 * var24));
               var23.a(var2[4].d() + (float)(var15 * var24));
               var23.b(var2[4].e() + (float)(var17 * var24));
               zama.a(var0, var21, var22, var1.u());
               zama.a(var0, var22, var23, var1.u());
               if (var1.d() == 0 && var1.k() == 2) {
                  var19 = (double)zbq.a(var1.j(), var1.C(), (int)var1.B(), (int)var19, var1.c().S());
               } else {
                  var19 += var1.B();
               }
            }

            return;
         }
      }
   }

   private static int a(zbo var0, boolean var1) {
      zif var2 = var0.c();
      double var3 = var0.n() ? zbuk.e(var0.l()) : var0.l();
      double var5 = var0.n() ? zbuk.e(var0.z()) : var0.z();
      double var7 = var0.n() ? zbuk.e(var0.D()) : var0.D();
      if (var0.p()) {
         var3 = var5 - var3;
      } else {
         var3 -= var7;
      }

      float var9 = var2.N().i();
      if (var1) {
         var9 = var2.N().g();
      }

      int var10 = (int)(var3 / (var5 - var7) * (double)var9);
      return var10;
   }

   private static boolean b(zif var0) {
      switch(var0.M()) {
      case 45:
      case 48:
         return true;
      default:
         return false;
      }
   }

   static boolean a(zif var0) {
      switch(var0.M()) {
      case 3:
      case 17:
      case 27:
      case 34:
      case 43:
      case 56:
         return true;
      default:
         return false;
      }
   }

   private static com.aspose.cells.b.a.b.zq a(com.aspose.cells.b.a.b.zo[] var0) {
      float var1 = 2.14748365E9F;
      float var2 = 0.0F;
      float var3 = 2.14748365E9F;
      float var4 = 0.0F;

      for(int var5 = 0; var5 < var0.length; ++var5) {
         com.aspose.cells.b.a.b.zo var6 = var0[var5];
         if (var6.d() < var3) {
            var3 = var6.d();
         }

         if (var6.d() > var4) {
            var4 = var6.d();
         }

         if (var6.e() < var1) {
            var1 = var6.e();
         }

         if (var6.e() > var2) {
            var2 = var6.e();
         }
      }

      return new com.aspose.cells.b.a.b.zq((float)((int)var3), (float)((int)var1), (float)((int)(var4 - var3)), (float)((int)(var2 - var1)));
   }
}
